package com.pkk.penguin.frame.know.java.interview.singleton;

import java.io.IOException;
import java.util.Properties;

/**
 * @description: 单例模式
 * @author: peikunkun
 * @create: 2019-12-28 17:25
 **/
public class SingletonInterview1 {
  public static SingletonInterview1 INSTANCE = null;

  static {
    Properties pro = new Properties();
    try {
      pro.load(SingletonInterview1.class.getClassLoader().getResourceAsStream("singleton.properties"));

      String singleton = pro.getProperty("singleton");

      INSTANCE = new SingletonInterview1(singleton);
    } catch (IOException e) {
      e.printStackTrace();
    }

  }

  private SingletonInterview1(String info) {
    this.info = info;
  }

  private String info;


  public String getInfo() {
    return info;
  }

  public void setInfo(String info) {
    this.info = info;
  }

  @Override
  public String toString() {
    return "SinletonInterview1{" +
        "info='" + info + '\'' +
        '}';
  }
}
